home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / Technical Documentation / PCI Information / PCI Developer’s Kit (disk) / PCI Testing / Read Me < prev    next >
Encoding:
Text File  |  1994-06-27  |  1.6 KB  |  45 lines  |  [TEXT/ttxt]

  1. PCITest.c is a simple test for PCI configuration space compliance testing. It writes and reads various config space registers and checks them for expected values according to the current PCI specification. There are a few routines that are hardware dependent and those must be supplied by the user. To use the test, simply add in the hardware specific code, compile it on your target machine, and run it as an application.
  2.  
  3. This is a first pass of the test suite.
  4.  
  5. The following external routines are localized hardware dependent abstraction layers that provide access to physical or simulated hardware
  6.  
  7. extern UInt8 GetPresentsBits(); /* Returns the two presents bits in bits 0 and 1 of byte */
  8.  
  9. /* Access to PCI configuration space is hardware dependent */
  10. extern UInt8  Read8_Config  (UInt32 RegisterOffset);
  11. extern void   Write8_Config (UInt32 RegisterOffset,UInt8  Data);
  12. extern UInt16 Read16_Config (UInt32 RegisterOffset);
  13. extern void   Write16_Config(UInt32 RegisterOffset,UInt16 Data);
  14. extern UInt32 Read32_Config (UInt32 RegisterOffset);
  15. extern void   Write32_Config(UInt32 RegisterOffset,UInt32 Data);
  16.  
  17.  
  18.  
  19. The following routine is the main loop and gives an idea of what is being tested:
  20.  
  21. void PCIComplianceTest()
  22. {
  23.         if (UnitUnderTestPresent())
  24.         {
  25.                 DisplayConfiguration();
  26.                 VendorIDCheck();
  27.                 DeviceIDCheck();
  28.                 CommandCheck();
  29.                 StatusCheck();
  30.                 ClassCodeCheck();
  31.                 RevisionCheck();
  32.                 BISTCheck();
  33.                 HeadTypeCheck();
  34.                 LatencyTimerCheck();
  35.                 CacheLineCheck();
  36.                 BaseRegistersCheck();
  37.                 ReservedRegistersCheck();
  38.                 ExpansionROMCheck();
  39.                 InterruptLineCheck();
  40.                 InterruptPinCheck();
  41.                 MinGrantCheck();
  42.                 MaxLatencyCheck();
  43.         }
  44. }
  45.